<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.xnx3.DateUtil"%>
<%@page import="com.xnx3.j2ee.Global"%>
<%@page import="com.xnx3.wangmarket.admin.G"%><%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:include page="../../../../iw/common/head.jsp">
    <jsp:param name="title" value="编辑用户所属部门"/>
</jsp:include>
<script src="<%=basePath+Global.CACHE_FILE %>Branch_branchid.js"></script>

<form id="form" method="post" class="layui-form" style="padding:10px; padding-top:20px; padding-right: 20px;margin-bottom: 10px; margin-top:0px;">
	<input type="hidden" value="${userBranch.userid }" name="userid">


   	<div class="layui-form-item">
		<label class="layui-form-label" id="label_columnName">用户昵称</label>
		<div class="layui-input-block">
			<input type="text" placeholder="限30个字符以内" class="layui-input" value="${user.nickname }" disabled="false" />
		</div>
	</div>
   	<div class="layui-form-item">
		<label class="layui-form-label" id="label_columnName">所属部门</label>
		<div class="layui-input-block">
			<script type="text/javascript">writeSelectAllOptionForbranchid_('${userBranch.branchid }','请选择', true);</script>
		</div>
	</div>

	<div class="layui-form-item" style="padding-top:15px;">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit="" lay-filter="demo1">保存修改</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	</div>
</form>

<script>
//自适应弹出层大小
//var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
//parent.layer.iframeAuto(index);

layui.use(['form', 'layedit', 'laydate', 'element'], function(){
  var form = layui.form;

  //监听提交
  form.on('submit(demo1)', function(data){
  		parent.iw.loading('保存中');
		var d=$("form").serialize();
        $.post("setBranchSave.do", d, function (obj) { 
        	parent.iw.loadClose();
        	if(obj.result == '1'){
        		parent.parent.iw.msgSuccess("操作成功");
        		parent.location.reload();	//刷新父窗口
        		parent.layer.close(index);
        	}else if(obj.result == '0'){
        		parent.layer.msg(obj.info, {shade: 0.3})
        	}else{
        		parent.layer.msg(result, {shade: 0.3})
        	}
         }, "json");
		
    return false;
  });
  
});

</script>

<jsp:include page="../../../../iw/common/foot.jsp"></jsp:include>